import BaseService from "../BaseService";

class UcResourceService extends BaseService {
  queryById(params) {
    return this.getAction(this.getModulePath() + `/queryById`, params);
  }

  queryList(params) {
    return this.getAction(this.getModulePath() + `/queryList`, params);
  }

  queryAuthResources(params) {
    return this.postAction(
      this.getModulePath() + `/queryAuthResources`,
      params
    );
  }

  queryAuthResourceMenu(params) {
    return this.postAction(
      this.getModulePath() + `/queryAuthResourceMenu`,
      params
    );
  }

  queryAuthResourcesDir(params) {
    return this.postAction(
      this.getModulePath() + `/queryAuthResourcesDir`,
      params
    );
  }

  /**
   * 描述:获取host地址
   * @returns {string}
   */
  getBaseUrl() {
    return this.serviceConfig.getBaseUrl("oauth");
  }

  queryAllResList(params) {
    return this.postAction(this.getModulePath()+`/queryAllResList`, params)
  }
  /**
   * 描述:获取模块地址
   * @returns {string}
   */
  getModulePath() {
    return "/publics/resources";
  }
}

export default new UcResourceService();
